package com.sunyur.tailor.channel.service.inner.purchase.model;

import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * @author U
 * @Description
 * @date 2022/6/9
 */
@Data
public class ScoreDetailVO implements Serializable {

    private static final long serialVersionUID = 405927100572442993L;
    /**
     * 评分模板基本信息
     */
    private ScoreTempVO scoreTemp;
    /**
     * 商务标指标
     */
    private List<CommercialItemsVO> commercialItems;
    /**
     * 技术标指标
     */
    private List<TechnologyItemsVO> technologyItems;

    @Data
    public static class ScoreTempVO implements Serializable{
        private static final long serialVersionUID = 1332774276688918115L;
        private Integer id;
        /**
         * 模板编码
         */
        private String purCode;
        /**
         * 模板名称
         */
        private String name;
        /**
         * 采购分类code
         */
        private String purchaseCategoryCode;
        /**
         * 采购分类名称
         */
        private String purchaseCategoryName;
        /**
         * 其他配置项
         */
        private TermsVO terms;
        private String status;
        private String createTime;
        private Integer creator;
        private String creatorName;
        private Integer version;
        private List<String> scoreItems;
        /**
         * 评分模板类型  0  评分模式  1 模板权重模式
         */
        private Integer type;
        /**
         * 评分模板支持类型  0 评分模板  1 RFI模板
         */
        private Integer scoreSupportType;

        @Data
        public static class TermsVO implements Serializable{
            private static final long serialVersionUID = -3858348681531003024L;
            /**
             * 是否开启分组
             */
            private Boolean enableGroup;
            /**
             * 是否开启技术标
             */
            private Boolean enableTechnology;
            /**
             * 是否开启商务标
             */
            private Boolean enableCommercial;
        }
    }

    @Data
    public static class CommercialItemsVO implements Serializable{
        private static final long serialVersionUID = -4252080983021624483L;
        /**
         * 指标信息
         */
        private ScoreTempItemVO scoreTempItem;
        /**
         * 参评人信息
         */
        private List<PartUsersVO> partUsers;

        @Data
        public static class ScoreTempItemVO implements Serializable{
            private static final long serialVersionUID = 3934259553145582964L;
            private Integer id;
            private String type;
            private Integer scoreTempId;
            private Integer priceScoreRuleId;
            /**
             * 指标名称
             */
            private String name;
            /**
             * 备注
             */
            private String remark;
            /**
             * 评分规则
             */
            private String scoreRule;
            /**
             * 最高分
             */
            private Integer maxScore;
            /**
             * 指标组
             */
            private String groupName;
            /**
             * 评分权重指标
             */
            private Integer weightRatio;
            private String fictitiousCode;
        }

        @Data
        public static class PartUsersVO implements Serializable{
            private static final long serialVersionUID = -3281229470608107239L;
            private String code;
            /**
             * 参评人姓名
             */
            private String name;
            /**
             * 参评用户工号
             */
            private String workNumber;
            /**
             * 邮箱
             */
            private String email;
            /**
             * 手机号
             */
            private String mobile;
            /**
             * 职位
             */
            private String position;
        }
    }

    @Data
    public static class TechnologyItemsVO implements Serializable{
        private static final long serialVersionUID = 8998741444801801078L;
        private ScoreTempItemVO scoreTempItem;
        private List<PartUsersVO> partUsers;

        @Data
        public static class ScoreTempItemVO implements Serializable{
            private static final long serialVersionUID = -2459652033912562237L;
            private Integer id;
            private String type;
            private Integer scoreTempId;
            private Integer priceScoreRuleId;
            private String name;
            private String remark;
            private String scoreRule;
            private Integer maxScore;
            private String groupName;
            private Integer weightRatio;
            private String fictitiousCode;
        }

        @Data
        public static class PartUsersVO implements Serializable{
            private static final long serialVersionUID = -6134002251862301984L;
            private String code;
            private String name;
            private String workNumber;
            private String email;
            private String mobile;
            private String position;
        }
    }
}
